package o;

import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class die {
    private Map<String, dif> ˊ = new LinkedHashMap();
    private final List<String> ˎ = new ArrayList();
    private Context ˏ;
    public String ॱ = "";

    public die(Context context) {
        this.ˏ = context;
        ˎ(null);
    }

    public die(Context context, Set<String> set, String str) {
        this.ˏ = context;
        ˎ((Set) set);
        this.ॱ = str;
    }

    public void ˎ(Set<String> set) {
        ॱ(set);
        this.ˎ.add("zjbbapps");
    }

    private void ॱ(Set<String> set) {
        for (Entry entry : dig.ॱ().entrySet()) {
            ˏ(set, (String) entry.getKey(), (dif) entry.getValue());
        }
    }

    private void ˏ(Set<String> set, String str, dif o_dif) {
        Object obj = ((set == null || set.contains(str)) && o_dif != null) ? null : 1;
        if (obj == null) {
            this.ˊ.put(str, o_dif);
        }
    }

    public void ˏ(String str) {
        this.ˊ.remove(str);
    }

    public boolean ॱ() {
        if (this.ˊ.isEmpty()) {
            return false;
        }
        return true;
    }

    public dif ˎ(String str) {
        if (TextUtils.isEmpty(str) || this.ˊ.isEmpty()) {
            return null;
        }
        return (dif) this.ˊ.get(str);
    }

    public boolean ˊ() {
        boolean z = true;
        ArrayList arrayList = new ArrayList();
        for (Entry entry : this.ˊ.entrySet()) {
            boolean z2;
            if (TextUtils.isEmpty(this.ॱ) || !this.ॱ.equals(entry.getKey())) {
                z2 = false;
            } else {
                z2 = true;
            }
            if (((dif) entry.getValue()).ˊ(z2) && (this.ˏ instanceof Activity)) {
                ((dif) entry.getValue()).ˊ((Activity) this.ˏ);
                this.ॱ = (String) entry.getKey();
                break;
            }
            arrayList.add(entry.getKey());
        }
        z = false;
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            this.ˊ.remove((String) it.next());
        }
        return z;
    }

    public Set<String> ˏ() {
        return this.ˊ.keySet();
    }

    public boolean ˎ() {
        if (this.ˎ.contains(this.ॱ)) {
            return true;
        }
        return false;
    }
}
